<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%-- 
    JSP Name : nt_300_13.jsp
    Description : 이벤트참여수정
    author Seung Won
    since 2012. 7. 19.
    version 1.0
    Modification Information
       since          author              description
    ===========    =============    ===========================
    2012. 7. 19.     Seung Won     최초 생성
--%>
<%@ include file="/WEB-INF/jsp/co/mn/include/declare.jspf" %>
<%@ include file="/WEB-INF/jsp/co/mn/include/session.jspf" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<%@ include file="/WEB-INF/jsp/co/mn/include/header.jspf" %>
<script type="text/javaScript" language="javascript">
<!--
$(document).ready(function() {
    /* form validation check */
    onloadCharCheck();
    
    $("#listButn").bind("click", moveListPage);     // 목록
    $("#updButn").bind("click", moveUpdPage);       // 수정
    $("#cpsButn").bind("click", chgPass);   
    $("#cnclButn").bind("click", formIniz);         /* Form 초기화 */
    
    
});



/*
 * 검색
 */
function moveListPage() {
    $("#mainForm").attr('action','/nt_300_26.do').submit();
}

/*
 * 수정
 */
function moveUpdPage() {
    
    var arrChk = "0";
    var arrChkSzVal = "";
    var arrChkQtyVal = "";
    
    if (!validateForm($("#mainForm"))) {
        return;
    }
    
    $("#mainForm").attr('target','comIframe');
    $("#mainForm").attr('action','/nt_300_28.do').submit();
}


function chgPass(){
    $("#mainForm").attr('target','comIframe');
    $("#mainForm").attr('action','/nt_300_29.do').submit();
}

/*
 * Form 초기화
 */
function formIniz() {
    document.mainForm.reset();
}


/* table append rows */
function fe_appendTable(){
	$(".appendRow").click(function(){
		var tr_obj    = document.getElementById("lineAppend");
		var clone_obj = tr_obj.cloneNode(true)
		tr_obj.parentNode.appendChild(clone_obj);
	});

	$(".deleteRow").click(function(){
		var tr_obj    = document.getElementById("lineAppend");
		var tbody_obj = tr_obj.parentNode;
		var tbl_obj   = tbody_obj.parentNode;
		var tbl_cnt   = tbl_obj.rows.length;
		if(tbl_cnt < 3) {
			alert("삭제할 수 없습니다.");
		return;
		}
		tr_obj.parentNode.removeChild(tbl_obj.rows[tbl_cnt-1]);
	});
}

//-->
</script>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>HMC GLOBAL CSR</title>
</head>
<body>
<div id="wrap">
    <!-- top -->
    <%@ include file="/WEB-INF/jsp/co/mn/include/top.jsp" %>
    <!-- top -->

    <!-- container -->
    <div id="container">
        <!-- LNB -->
        <%@ include file="/WEB-INF/jsp/co/mn/include/left.jsp" %>
        <!-- LNB -->
        
        <div id="contents">
            
            <!-- location -->
            <%@ include file="/WEB-INF/jsp/co/mn/include/location.jsp" %>
            <!-- location -->
            <form id="mainForm" name="mainForm" method="post">
            <input type="hidden" id="currentPageNo" name="currentPageNo" value="${rqInfo.currentPageNo}" />
            <input type="hidden" id="parp03Idx" name="parp06Idx" value="${result.parp06Idx }" />
            <input type="hidden" id="evntIdx" name="evntIdx" value="${result.evntIdx }" />
            <input type="hidden" id="mlgScnCd" name="mlgScnCd" value="KO" />
            <p class="msgTbtitle">1.신청자 정보<!-- img src="/img/usr/pop/pop_tit_h_volunteer_1.gif" alt="H-Family Volunteer 활동 신청" / --></p>
	        <table border="1" class="frmTable" summary="H-Family Volunteer 신청자이름, 핸드폰 이메일을 입력 또는 수정하는 표">
	            <col width="16%" />
	            <col width="34%" />
	            <col width="16%" />
	            <col width="34%" />
	            <tbody>
	                <tr>
	                    <th>신청자 이름</td> 
	                    <td colspan="3"><input type="text" class="frmName" title="신청자 이름 " id="aplcNm" name="aplcNm" value="${result.ppprNm}" maxlength="10" nullable="true" /></td>
	                    
	                </tr>
	                <tr>
	                    <th>핸드폰</th>
	                    <td colspan="3">
	                        <select name="aplcHp1">
	                                <option value="010" <c:if test="${result.aplcHp1 == '010' }">selected</c:if> >010</option>
	                                <option value="011" <c:if test="${result.aplcHp1 == '011' }">selected</c:if> >011</option>
	                                <option value="016" <c:if test="${result.aplcHp1 == '016' }">selected</c:if> >016</option>
	                                <option value="017" <c:if test="${result.aplcHp1 == '017' }">selected</c:if> >017</option>
	                                <option value="019" <c:if test="${result.aplcHp1 == '019' }">selected</c:if> >019</option>
	                            </select> - <input type="text"  class="frmCall" title="앞자리" id="aplcHp2" name="aplcHp2" value="${result.aplcHp2 }" maxlength="4" nullable="true" chartype="onlynum" /> - 
	                            <input type="text"  class="frmCall" title="뒤 4자리" id="aplcHp3" name="aplcHp3" value="${result.aplcHp3 }" maxlength="4" nullable="true" chartype="onlynum"  />
	                    </td>
	                </tr>
	                <tr>
	                    <th>이메일</th>
	                    <td colspan="3"><input type="text"  class="frmEmail" id="aplcEml1" name="aplcEml1" value="${arrAplcEml[0] }" maxlength="14" nullable="true" title="이메일" style="ime-mode:inactive" />
	                     &#64; <input type="text" class="frmEmail" id="aplcEml2" name="aplcEml2" value="${arrAplcEml[1] }" maxlength="14" nullable="true" title="이메일" style="ime-mode:inactive;width: 130px"/><span class="desc">게시물 수정시 필요한 주소이므로 꼭 기억해 주세요.</span>
	                     <input type="hidden" id="aplcEml" name="aplcEml" value="${result.aplcEml }"/>
	                   </td>
	                </tr>
	            </tbody>
	        </table>
	        
	        
	  		<div class="appendTable">
	        <p class="msgTbtitle">2.참여자 정보<!--img src="/img/usr/pop/pop_tit_h_volunteer_2.gif" alt="봉사활동 관련내용" /--></p><br/><br/>
	        <table border="1" class="frmTable" >
	            <col width="13%" />
	            <col width="11%" />
	            <col width="26%" />
	            <col width="10%" />
	            <col width="13%" />
	            <col width="*" />
	            <tbody>
	                <tr>
	                    <th style="padding-left: 0;text-align: center;">구분</td>
	                    <th style="padding-left: 0;text-align: center;">이름</td>
	                    <th style="padding-left: 0;text-align: center;">생년월일</td>
	                    <th style="padding-left: 0;text-align: center;">성별</td>
	                    <th style="padding-left: 0;text-align: center;">소속</td>
	                    <th style="padding-left: 0;text-align: center;">휴대전화</td>
	                </tr>
	                <c:choose>
	                <c:when test="${hvt01List != null && !empty hvt01List }">
	                <c:forEach var="hvt01List" items="${hvt01List }" varStatus="status">
	                <tr id="lineAppend">
	                	<td style="border-left: 0px">
	                		<select name="famGubn">
	                			<option value="01" <c:if test="${hvt01List.teamNm == '01' }">selected</c:if>>임직원</option>
	                			<option value="02" <c:if test="${hvt01List.teamNm == '02' }">selected</c:if>>임직원가족</option>
	                		</select>
	                	</td>
	                	<td>
	                		<input type="text" title="이름 " id="famNm" name="famNm" value="${hvt01List.aplcNm }" maxlength="10" nullable="true" style="width: 90%"/>
	                	</td>
	                	<td style="padding-left: 0px;padding-right: 0;text-align: center;"> 
	                		<select id="gactEraStrtY" name="gactEraStrtY">
	                            <c:forEach var="list" items="${yearList }">
	                            <option value="${list }" <c:if test="${hvt01List.gactEraStrtY == list }">selected</c:if> >${list }년</option>
	                            </c:forEach>
	                        </select>
	                        <select id="gactEraStrtM" name="gactEraStrtM">
	                            <c:forEach var="list" items="${monList }">
	                            <option value="${list }" <c:if test="${hvt01List.gactEraStrtM == list }">selected</c:if> >${list }월</option>
	                            </c:forEach>
	                        </select>
	                        <select id="gactEraStrtD" name="gactEraStrtD">
	                            <c:forEach var="list" items="${dayList }">
	                            <option value="${list }" <c:if test="${hvt01List.gactEraStrtD == list }">selected</c:if> >${list }일</option>
	                            </c:forEach>
	                        </select>
	                	</td>
	                	<td>
	                		<select name="famSex">
	                			<option value="M" <c:if test="${hvt01List.sex == 'M' }">selected</c:if>>남성</option>
	                			<option value="F" <c:if test="${hvt01List.sex == 'F' }">selected</c:if>>여성</option>
		              		</select>
	                	</td>
	                	<td><input type="text" title="소속" id="famSosok" name="famSosok" value="${hvt01List.blns }" maxlength="10" nullable="true" style="width: 90%"/>
	                	</td>
	                	<td>    <select name="famHp1">
	                                <option value="010" <c:if test="${hvt01List.aplcHp1 == '010' }">selected</c:if> >010</option>
	                                <option value="011" <c:if test="${hvt01List.aplcHp1 == '011' }">selected</c:if> >011</option>
	                                <option value="016" <c:if test="${hvt01List.aplcHp1 == '016' }">selected</c:if> >016</option>
	                                <option value="017" <c:if test="${hvt01List.aplcHp1 == '017' }">selected</c:if> >017</option>
	                                <option value="019" <c:if test="${hvt01List.aplcHp1 == '019' }">selected</c:if> >019</option>
	                            </select> - <input type="text" class="phone" title="앞자리" id="famHp2" name="famHp2" value="${hvt01List.aplcHp2 }" maxlength="4" nullable="true" chartype="onlynum" style="width: 45px"/> - 
	                            <input type="text" class="phone" title="뒤 4자리" id="famHp3" name="famHp3" value="${hvt01List.aplcHp3 }" maxlength="4" nullable="true" chartype="onlynum" style="width: 45px"/>
	                	
	                	</td>
	                </tr>
	                </c:forEach>
	                </c:when>
	                <c:otherwise>
	                <c:forEach var="i"  begin="1" end="4">
	                <tr id="lineAppend">
	                	<td style="border-left: 0px">
	                		<select name="famGubn">
	                			<option value="01">임직원</option>
	                			<option value="02">임직원가족</option>
	                		</select>
	                	</td>
	                	<td>
	                		<input type="text" title="이름 " id="famNm" name="famNm" value="" maxlength="10" nullable="true" style="width: 90%"/>
	                	</td>
	                	<td style="padding-left: 0px;padding-right: 0;text-align: center;"> 
	                		<select id="gactEraStrtY" name="gactEraStrtY">
	                            <c:forEach var="list" items="${yearList }">
	                            <option value="${list }" >${list }년</option>
	                            </c:forEach>
	                        </select>
	                        <select id="gactEraStrtM" name="gactEraStrtM">
	                            <c:forEach var="list" items="${monList }">
	                            <option value="${list }" >${list }월</option>
	                            </c:forEach>
	                        </select>
	                        <select id="gactEraStrtD" name="gactEraStrtD">
	                            <c:forEach var="list" items="${dayList }">
	                            <option value="${list }"  >${list }일</option>
	                            </c:forEach>
	                        </select>
	                	</td>
	                	<td>
	                		<select name="famSex">
	                			<option value="M">남성</option>
	                			<option value="F">여성</option>
		              		</select>
	                	</td>
	                	<td><input type="text" title="소속" id="famSosok" name="famSosok" value="${result.aplcNm }" maxlength="10" nullable="true" style="width: 90%"/>
	                	</td>
	                	<td>    <select name="famHp1">
	                                <option value="010" >010</option>
	                                <option value="011" >011</option>
	                                <option value="016" >016</option>
	                                <option value="017" >017</option>
	                                <option value="019" >019</option>
	                            </select> - <input type="text" class="phone" title="앞자리" id="famHp2" name="famHp2" value="" maxlength="4" nullable="true" chartype="onlynum" style="width: 45px"/> - 
	                            <input type="text" class="phone" title="뒤 4자리" id="famHp3" name="famHp3" value="" maxlength="4" nullable="true" chartype="onlynum" style="width: 45px"/>
	                	
	                	</td>
	                </tr>
	                </c:forEach>
	                </c:otherwise>
	                </c:choose>
	            </tbody>
	        </table>
	        <div class="btnRows" style="text-align: right;margin-top: 10px"><button type="button" class="appendRow"><img src="/img/usr/btn/btn_row_apd.gif" alt="추가" /></button><button type="button" class="deleteRow"><img src="/img/usr/btn/btn_row_del.gif" alt="삭제" /></button></div>
	        </div>
            </form>
            <div class="btnBoard">
                <span class="flow">
                    <input type="submit" id="listButn" title="목록" value="목록" />
                </span>
                <span class="reverse">
                    <input type="submit" id="cpsButn" title="비밀번호 초기화" value="초기화" />
                    <input type="submit" id="updButn" title="수정" value="수정" />
                    <input type="submit" id="cnclButn" title="취소" value="취소" />
                </span>
            </div>
        </div>
    </div>
    
    <!-- /container -->

    <!-- footer -->
    <%@ include file="/WEB-INF/jsp/co/mn/include/bottom.jsp" %>
    <!-- /footer -->
</div>
</body>
</html>